#pragma once

#include "D3D11Enum.h"

namespace DX4WRT
{
	namespace Direct3D11
	{
		public ref class SubresourceData sealed
		{
			public:

			internal:
				D3D11_SUBRESOURCE_DATA m_Data;
		};

		public ref class BufferDescription sealed
		{
			public:
				BufferDescription ()
				{
					m_Desc.ByteWidth = 0;
					m_Desc.BindFlags = D3D11_BIND_SHADER_RESOURCE;
					m_Desc.Usage = D3D11_USAGE_DEFAULT;
					m_Desc.CPUAccessFlags = 0;
					m_Desc.MiscFlags = 0;
					m_Desc.StructureByteStride = 0;
				}
				~BufferDescription ()
				{
				}

				property uint32 ByteWidth {uint32 get() {return m_Desc.ByteWidth;} void set (uint32 value) {m_Desc.ByteWidth=value;}}
				property DX4WRT::Direct3D11::Usage Usage {DX4WRT::Direct3D11::Usage get() {return (DX4WRT::Direct3D11::Usage)m_Desc.Usage;} void set (DX4WRT::Direct3D11::Usage value) {m_Desc.Usage=(D3D11_USAGE)value;}}
				property DX4WRT::Direct3D11::Bind Bind {DX4WRT::Direct3D11::Bind get() {return (DX4WRT::Direct3D11::Bind)m_Desc.BindFlags;} void set (DX4WRT::Direct3D11::Bind value) {m_Desc.BindFlags=(UINT)value;}}
				property DX4WRT::Direct3D11::CPUAccess CPUAccess {DX4WRT::Direct3D11::CPUAccess get() {return (DX4WRT::Direct3D11::CPUAccess)m_Desc.CPUAccessFlags;} void set (DX4WRT::Direct3D11::CPUAccess value) {m_Desc.CPUAccessFlags=(UINT)value;}}
				property DX4WRT::Direct3D11::ResourceMisc Misc {DX4WRT::Direct3D11::ResourceMisc get() {return (DX4WRT::Direct3D11::ResourceMisc)m_Desc.MiscFlags;} void set (DX4WRT::Direct3D11::ResourceMisc value) {m_Desc.MiscFlags=(UINT)value;}}
				property uint32 StructureByteStride {uint32 get() {return m_Desc.StructureByteStride;} void set (uint32 value) {m_Desc.StructureByteStride=value;}}

			internal:
				D3D11_BUFFER_DESC m_Desc;
		};

		public ref class Texture1DDescription sealed
		{
			public:
				Texture1DDescription ()
				{
					m_Desc.Format = DXGI_FORMAT_UNKNOWN;
					m_Desc.Width = 0;
					m_Desc.ArraySize = 1,
					m_Desc.MipLevels = 0,
					m_Desc.BindFlags = D3D11_BIND_SHADER_RESOURCE;
					m_Desc.Usage = D3D11_USAGE_DEFAULT;
					m_Desc.CPUAccessFlags = 0;
					m_Desc.MiscFlags = 0;
				}
				~Texture1DDescription ()
				{
				}

				property uint32 Width {uint32 get() {return m_Desc.Width;} void set (uint32 value) {m_Desc.Width=value;}}
				property uint32 MipLevels {uint32 get() {return m_Desc.MipLevels;} void set (uint32 value) {m_Desc.MipLevels=value;}}
				property uint32 ArraySize {uint32 get() {return m_Desc.ArraySize;} void set (uint32 value) {m_Desc.ArraySize=value;}}
				property DX4WRT::DXGI::Format Format {DX4WRT::DXGI::Format get() {return (DX4WRT::DXGI::Format)m_Desc.Format;}  void set (DX4WRT::DXGI::Format value) {m_Desc.Format=(DXGI_FORMAT)value;}}
				property DX4WRT::Direct3D11::Usage Usage {DX4WRT::Direct3D11::Usage get() {return (DX4WRT::Direct3D11::Usage)m_Desc.Usage;} void set (DX4WRT::Direct3D11::Usage value) {m_Desc.Usage=(D3D11_USAGE)value;}}
				property DX4WRT::Direct3D11::Bind Bind {DX4WRT::Direct3D11::Bind get() {return (DX4WRT::Direct3D11::Bind)m_Desc.BindFlags;} void set (DX4WRT::Direct3D11::Bind value) {m_Desc.BindFlags=(UINT)value;}}
				property DX4WRT::Direct3D11::CPUAccess CPUAccess {DX4WRT::Direct3D11::CPUAccess get() {return (DX4WRT::Direct3D11::CPUAccess)m_Desc.CPUAccessFlags;} void set (DX4WRT::Direct3D11::CPUAccess value) {m_Desc.CPUAccessFlags=(UINT)value;}}
				property DX4WRT::Direct3D11::ResourceMisc Misc {DX4WRT::Direct3D11::ResourceMisc get() {return (DX4WRT::Direct3D11::ResourceMisc)m_Desc.MiscFlags;} void set (DX4WRT::Direct3D11::ResourceMisc value) {m_Desc.MiscFlags=(UINT)value;}}

			internal:
				D3D11_TEXTURE1D_DESC m_Desc;
		};

		public ref class Texture2DDescription sealed
		{
			public:
				Texture2DDescription ()
				{
					m_Desc.Format = DXGI_FORMAT_UNKNOWN;
					m_Desc.Width = 0;
					m_Desc.Height = 0;
					m_Desc.ArraySize = 1,
					m_Desc.MipLevels = 0,
					m_Desc.BindFlags = D3D11_BIND_SHADER_RESOURCE;
					m_Desc.Usage = D3D11_USAGE_DEFAULT;
					m_Desc.CPUAccessFlags = 0;
					m_Desc.SampleDesc.Count = 1;
					m_Desc.SampleDesc.Quality = 0;
					m_Desc.MiscFlags = 0;
				}
				~Texture2DDescription ()
				{
				}

				property uint32 Width {uint32 get() {return m_Desc.Width;} void set (uint32 value) {m_Desc.Width=value;}}
				property uint32 Height {uint32 get() {return m_Desc.Height;} void set (uint32 value) {m_Desc.Height=value;}}
				property uint32 MipLevels {uint32 get() {return m_Desc.MipLevels;} void set (uint32 value) {m_Desc.MipLevels=value;}}
				property uint32 ArraySize {uint32 get() {return m_Desc.ArraySize;} void set (uint32 value) {m_Desc.ArraySize=value;}}
				property DX4WRT::DXGI::Format Format {DX4WRT::DXGI::Format get() {return (DX4WRT::DXGI::Format)m_Desc.Format;}  void set (DX4WRT::DXGI::Format value) {m_Desc.Format=(DXGI_FORMAT)value;}}
				property uint32 SampleCount {uint32 get() {return m_Desc.SampleDesc.Count;} void set (uint32 value) {m_Desc.SampleDesc.Count=value;}}
				property uint32 SampleQuality {uint32 get() {return m_Desc.SampleDesc.Quality;} void set (uint32 value) {m_Desc.SampleDesc.Quality=value;}}
				property DX4WRT::Direct3D11::Usage Usage {DX4WRT::Direct3D11::Usage get() {return (DX4WRT::Direct3D11::Usage)m_Desc.Usage;} void set (DX4WRT::Direct3D11::Usage value) {m_Desc.Usage=(D3D11_USAGE)value;}}
				property DX4WRT::Direct3D11::Bind Bind {DX4WRT::Direct3D11::Bind get() {return (DX4WRT::Direct3D11::Bind)m_Desc.BindFlags;} void set (DX4WRT::Direct3D11::Bind value) {m_Desc.BindFlags=(UINT)value;}}
				property DX4WRT::Direct3D11::CPUAccess CPUAccess {DX4WRT::Direct3D11::CPUAccess get() {return (DX4WRT::Direct3D11::CPUAccess)m_Desc.CPUAccessFlags;} void set (DX4WRT::Direct3D11::CPUAccess value) {m_Desc.CPUAccessFlags=(UINT)value;}}
				property DX4WRT::Direct3D11::ResourceMisc Misc {DX4WRT::Direct3D11::ResourceMisc get() {return (DX4WRT::Direct3D11::ResourceMisc)m_Desc.MiscFlags;} void set (DX4WRT::Direct3D11::ResourceMisc value) {m_Desc.MiscFlags=(UINT)value;}}

			internal:
				D3D11_TEXTURE2D_DESC m_Desc;
		};

		public ref class Texture3DDescription sealed
		{
			public:
				Texture3DDescription ()
				{
					m_Desc.Format = DXGI_FORMAT_UNKNOWN;
					m_Desc.Width = 0;
					m_Desc.Height = 0;
					m_Desc.Depth = 0;
					m_Desc.MipLevels = 0,
					m_Desc.BindFlags = D3D11_BIND_SHADER_RESOURCE;
					m_Desc.Usage = D3D11_USAGE_DEFAULT;
					m_Desc.CPUAccessFlags = 0;
					m_Desc.MiscFlags = 0;
				}
				~Texture3DDescription ()
				{
				}

				property uint32 Width {uint32 get() {return m_Desc.Width;} void set (uint32 value) {m_Desc.Width=value;}}
				property uint32 Height {uint32 get() {return m_Desc.Height;} void set (uint32 value) {m_Desc.Height=value;}}
				property uint32 Depth {uint32 get() {return m_Desc.Depth;} void set (uint32 value) {m_Desc.Depth=value;}}
				property uint32 MipLevels {uint32 get() {return m_Desc.MipLevels;} void set (uint32 value) {m_Desc.MipLevels=value;}}
				property DX4WRT::DXGI::Format Format {DX4WRT::DXGI::Format get() {return (DX4WRT::DXGI::Format)m_Desc.Format;}  void set (DX4WRT::DXGI::Format value) {m_Desc.Format=(DXGI_FORMAT)value;}}
				property DX4WRT::Direct3D11::Usage Usage {DX4WRT::Direct3D11::Usage get() {return (DX4WRT::Direct3D11::Usage)m_Desc.Usage;} void set (DX4WRT::Direct3D11::Usage value) {m_Desc.Usage=(D3D11_USAGE)value;}}
				property DX4WRT::Direct3D11::Bind Bind {DX4WRT::Direct3D11::Bind get() {return (DX4WRT::Direct3D11::Bind)m_Desc.BindFlags;} void set (DX4WRT::Direct3D11::Bind value) {m_Desc.BindFlags=(UINT)value;}}
				property DX4WRT::Direct3D11::CPUAccess CPUAccess {DX4WRT::Direct3D11::CPUAccess get() {return (DX4WRT::Direct3D11::CPUAccess)m_Desc.CPUAccessFlags;} void set (DX4WRT::Direct3D11::CPUAccess value) {m_Desc.CPUAccessFlags=(UINT)value;}}
				property DX4WRT::Direct3D11::ResourceMisc Misc {DX4WRT::Direct3D11::ResourceMisc get() {return (DX4WRT::Direct3D11::ResourceMisc)m_Desc.MiscFlags;} void set (DX4WRT::Direct3D11::ResourceMisc value) {m_Desc.MiscFlags=(UINT)value;}}

			internal:
				D3D11_TEXTURE3D_DESC m_Desc;
		};

		public ref class ShaderResourceViewDescription
		{
			public:

			internal:
				D3D11_SHADER_RESOURCE_VIEW_DESC m_Desc;
		};

		public ref class UnorderedAccessViewDescription
		{
			public:

			internal:
				D3D11_UNORDERED_ACCESS_VIEW_DESC m_Desc;
		};

		public ref class RenderTargetViewDescription
		{
			public:

			internal:
				D3D11_RENDER_TARGET_VIEW_DESC m_Desc;
		};

		public ref class DepthStencilViewDescription
		{
			public:

			internal:
				D3D11_DEPTH_STENCIL_VIEW_DESC m_Desc;
		};

		public ref class InputElementDescription
		{
			public:
				InputElementDescription ()
				{
				}


			internal:
				D3D11_INPUT_ELEMENT_DESC m_Desc;
		};

		public ref class StreamOutDeclarationEntry
		{
			public:
				StreamOutDeclarationEntry ()
				{
				}

			
			internal:
				D3D11_SO_DECLARATION_ENTRY m_Decl;
		};

		public ref class BlendDescription
		{
			internal:
				D3D11_BLEND_DESC m_Desc;
		};

		public ref class DepthStencilDescription
		{
			public:
				DepthStencilDescription ()
				{
					m_Desc.DepthEnable = TRUE;
					m_Desc.DepthWriteMask = D3D11_DEPTH_WRITE_MASK_ALL;
					m_Desc.DepthFunc = D3D11_COMPARISON_LESS;
					m_Desc.StencilEnable = FALSE;
					m_Desc.StencilReadMask = D3D11_DEFAULT_STENCIL_READ_MASK;
					m_Desc.StencilWriteMask = D3D11_DEFAULT_STENCIL_WRITE_MASK;
					const D3D11_DEPTH_STENCILOP_DESC defaultStencilOp =	{ D3D11_STENCIL_OP_KEEP, D3D11_STENCIL_OP_KEEP, D3D11_STENCIL_OP_KEEP, D3D11_COMPARISON_ALWAYS };
					m_Desc.FrontFace = defaultStencilOp;
					m_Desc.BackFace = defaultStencilOp;
				}

				property bool DepthEnable {bool get() {return m_Desc.DepthEnable;} void set (bool value) {m_Desc.DepthEnable=value;}}
				property DX4WRT::Direct3D11::DepthWriteMask DepthWriteMask {DX4WRT::Direct3D11::DepthWriteMask get() {return (DX4WRT::Direct3D11::DepthWriteMask)m_Desc.DepthWriteMask;} void set (DX4WRT::Direct3D11::DepthWriteMask value) {m_Desc.DepthWriteMask=(D3D11_DEPTH_WRITE_MASK)value;}}
				property DX4WRT::Direct3D11::ComparisonFunction DepthFunction {DX4WRT::Direct3D11::ComparisonFunction get() {return (DX4WRT::Direct3D11::ComparisonFunction)m_Desc.DepthFunc;} void set (DX4WRT::Direct3D11::ComparisonFunction value) {m_Desc.DepthFunc=(D3D11_COMPARISON_FUNC)value;}}
				property bool StencilEnable {bool get() {return m_Desc.StencilEnable;} void set (bool value) {m_Desc.StencilEnable=value;}}
				property uint8 StencilReadMask {uint8 get() {return m_Desc.StencilReadMask;} void set (uint8 value) {m_Desc.StencilReadMask=value;}}
				property uint8 StencilWriteMask {uint8 get() {return m_Desc.StencilWriteMask;} void set (uint8 value) {m_Desc.StencilWriteMask=value;}}

				property DX4WRT::Direct3D11::StencilOperation FrontFaceStencilFailOperation {DX4WRT::Direct3D11::StencilOperation get() {return (DX4WRT::Direct3D11::StencilOperation)m_Desc.FrontFace.StencilFailOp;} void set (DX4WRT::Direct3D11::StencilOperation value) {m_Desc.FrontFace.StencilFailOp=(D3D11_STENCIL_OP)value;}}
				property DX4WRT::Direct3D11::StencilOperation FrontFaceStencilDepthFailOperation {DX4WRT::Direct3D11::StencilOperation get() {return (DX4WRT::Direct3D11::StencilOperation)m_Desc.FrontFace.StencilDepthFailOp;} void set (DX4WRT::Direct3D11::StencilOperation value) {m_Desc.FrontFace.StencilDepthFailOp=(D3D11_STENCIL_OP)value;}}
				property DX4WRT::Direct3D11::StencilOperation FrontFaceStencilPassOperation {DX4WRT::Direct3D11::StencilOperation get() {return (DX4WRT::Direct3D11::StencilOperation)m_Desc.FrontFace.StencilPassOp;} void set (DX4WRT::Direct3D11::StencilOperation value) {m_Desc.FrontFace.StencilPassOp=(D3D11_STENCIL_OP)value;}}
				property DX4WRT::Direct3D11::ComparisonFunction FrontFaceStencilFunction {DX4WRT::Direct3D11::ComparisonFunction get() {return (DX4WRT::Direct3D11::ComparisonFunction)m_Desc.FrontFace.StencilFunc;} void set (DX4WRT::Direct3D11::ComparisonFunction value) {m_Desc.FrontFace.StencilFunc=(D3D11_COMPARISON_FUNC)value;}}

				property DX4WRT::Direct3D11::StencilOperation BackFaceStencilFailOperation {DX4WRT::Direct3D11::StencilOperation get() {return (DX4WRT::Direct3D11::StencilOperation)m_Desc.BackFace.StencilFailOp;} void set (DX4WRT::Direct3D11::StencilOperation value) {m_Desc.BackFace.StencilFailOp=(D3D11_STENCIL_OP)value;}}
				property DX4WRT::Direct3D11::StencilOperation BackFaceStencilDepthFailOperation {DX4WRT::Direct3D11::StencilOperation get() {return (DX4WRT::Direct3D11::StencilOperation)m_Desc.BackFace.StencilDepthFailOp;} void set (DX4WRT::Direct3D11::StencilOperation value) {m_Desc.BackFace.StencilDepthFailOp=(D3D11_STENCIL_OP)value;}}
				property DX4WRT::Direct3D11::StencilOperation BackFaceStencilPassOperation {DX4WRT::Direct3D11::StencilOperation get() {return (DX4WRT::Direct3D11::StencilOperation)m_Desc.BackFace.StencilPassOp;} void set (DX4WRT::Direct3D11::StencilOperation value) {m_Desc.BackFace.StencilPassOp=(D3D11_STENCIL_OP)value;}}
				property DX4WRT::Direct3D11::ComparisonFunction BackFaceStencilFunction {DX4WRT::Direct3D11::ComparisonFunction get() {return (DX4WRT::Direct3D11::ComparisonFunction)m_Desc.BackFace.StencilFunc;} void set (DX4WRT::Direct3D11::ComparisonFunction value) {m_Desc.BackFace.StencilFunc=(D3D11_COMPARISON_FUNC)value;}}

			internal:
				D3D11_DEPTH_STENCIL_DESC m_Desc;
		};

		public ref class RasterizerDescription
		{
			public:
				RasterizerDescription ()
				{
					m_Desc.FillMode = D3D11_FILL_SOLID;
					m_Desc.CullMode = D3D11_CULL_BACK;
					m_Desc.FrontCounterClockwise = false;
					m_Desc.DepthBias = D3D11_DEFAULT_DEPTH_BIAS;
					m_Desc.DepthBiasClamp = D3D11_DEFAULT_DEPTH_BIAS_CLAMP;
					m_Desc.SlopeScaledDepthBias = D3D11_DEFAULT_SLOPE_SCALED_DEPTH_BIAS;
					m_Desc.DepthClipEnable = true;
					m_Desc.ScissorEnable = false;
					m_Desc.MultisampleEnable = false;
					m_Desc.AntialiasedLineEnable = false;
				}

				property DX4WRT::Direct3D11::FillMode FillMode {DX4WRT::Direct3D11::FillMode get() {return (DX4WRT::Direct3D11::FillMode)m_Desc.FillMode;} void set (DX4WRT::Direct3D11::FillMode value) {m_Desc.FillMode=(D3D11_FILL_MODE)value;}}
				property DX4WRT::Direct3D11::CullMode CullMode {DX4WRT::Direct3D11::CullMode get() {return (DX4WRT::Direct3D11::CullMode)m_Desc.CullMode;} void set (DX4WRT::Direct3D11::CullMode value) {m_Desc.CullMode=(D3D11_CULL_MODE)value;}}
				property bool FrontCounterClockwise {bool get() {return m_Desc.FrontCounterClockwise;} void set (bool value) {m_Desc.FrontCounterClockwise=value;}}
				property uint32 DepthBias {uint32 get() {return m_Desc.DepthBias;} void set (uint32 value) {m_Desc.DepthBias=value;}}
				property float DepthBiasClamp {float get() {return m_Desc.DepthBiasClamp;} void set (float value) {m_Desc.DepthBiasClamp=value;}}
				property float SlopeScaledDepthBias {float get() {return m_Desc.SlopeScaledDepthBias;} void set (float value) {m_Desc.SlopeScaledDepthBias=value;}}
				property bool DepthClipEnable {bool get() {return m_Desc.DepthClipEnable;} void set (bool value) {m_Desc.DepthClipEnable=value;}}
				property bool ScissorEnable {bool get() {return m_Desc.ScissorEnable;} void set (bool value) {m_Desc.ScissorEnable=value;}}
				property bool MultisampleEnable {bool get() {return m_Desc.MultisampleEnable;} void set (bool value) {m_Desc.MultisampleEnable=value;}}
				property bool AntialiasedLineEnable {bool get() {return m_Desc.AntialiasedLineEnable;} void set (bool value) {m_Desc.AntialiasedLineEnable=value;}}

			internal:
				D3D11_RASTERIZER_DESC m_Desc;
		};

		public ref class SamplerDescription sealed
		{
			public:
				SamplerDescription ()
				{
					m_Desc.Filter = D3D11_FILTER_MIN_MAG_MIP_LINEAR;
					m_Desc.AddressU = D3D11_TEXTURE_ADDRESS_CLAMP;
					m_Desc.AddressV = D3D11_TEXTURE_ADDRESS_CLAMP;
					m_Desc.AddressW = D3D11_TEXTURE_ADDRESS_CLAMP;
					m_Desc.MipLODBias = 0;
					m_Desc.MaxAnisotropy = 1;
					m_Desc.ComparisonFunc = D3D11_COMPARISON_NEVER;
					m_Desc.BorderColor[ 0 ] = 1.0f;
					m_Desc.BorderColor[ 1 ] = 1.0f;
					m_Desc.BorderColor[ 2 ] = 1.0f;
					m_Desc.BorderColor[ 3 ] = 1.0f;
					m_Desc.MinLOD = -3.402823466e+38F; // -FLT_MAX
					m_Desc.MaxLOD = 3.402823466e+38F;
				}

				property DX4WRT::Direct3D11::Filter Filter {DX4WRT::Direct3D11::Filter get() {return (DX4WRT::Direct3D11::Filter)m_Desc.Filter;} void set (DX4WRT::Direct3D11::Filter value) {m_Desc.Filter=(D3D11_FILTER)value;}}
				property DX4WRT::Direct3D11::TextureAddressMode AddressU {DX4WRT::Direct3D11::TextureAddressMode get() {return (DX4WRT::Direct3D11::TextureAddressMode)m_Desc.AddressU;} void set (DX4WRT::Direct3D11::TextureAddressMode value) {m_Desc.AddressU=(D3D11_TEXTURE_ADDRESS_MODE)value;}}
				property DX4WRT::Direct3D11::TextureAddressMode AddressV {DX4WRT::Direct3D11::TextureAddressMode get() {return (DX4WRT::Direct3D11::TextureAddressMode)m_Desc.AddressV;} void set (DX4WRT::Direct3D11::TextureAddressMode value) {m_Desc.AddressV=(D3D11_TEXTURE_ADDRESS_MODE)value;}}
				property DX4WRT::Direct3D11::TextureAddressMode AddressW {DX4WRT::Direct3D11::TextureAddressMode get() {return (DX4WRT::Direct3D11::TextureAddressMode)m_Desc.AddressW;} void set (DX4WRT::Direct3D11::TextureAddressMode value) {m_Desc.AddressW=(D3D11_TEXTURE_ADDRESS_MODE)value;}}
				property float MipLODBias {float get() {return m_Desc.MipLODBias;} void set (float value) {m_Desc.MipLODBias=value;}}
				property uint32 MaxAnisotropy {uint32 get() {return m_Desc.MaxAnisotropy;} void set (uint32 value) {m_Desc.MaxAnisotropy=value;}}
				property DX4WRT::Direct3D11::ComparisonFunction ComparisonFunction {DX4WRT::Direct3D11::ComparisonFunction get() {return (DX4WRT::Direct3D11::ComparisonFunction)m_Desc.ComparisonFunc;} void set (DX4WRT::Direct3D11::ComparisonFunction value) {m_Desc.ComparisonFunc=(D3D11_COMPARISON_FUNC)value;}}
				property array<float>^ BorderColor
				{
					array<float>^ get ()
					{
						array<float>^ result = ref new array<float>(4);

						memcpy (&result[0], &m_Desc.BorderColor[0], sizeof(m_Desc.BorderColor));

						return result;
					}

					void set (array<float>^ value)
					{
						memcpy (&m_Desc.BorderColor[0], &value[0], sizeof(m_Desc.BorderColor));
					}
				}
				property float MinLOD {float get() {return m_Desc.MinLOD;} void set (float value) {m_Desc.MinLOD=value;}}
				property float MaxLOD {float get() {return m_Desc.MaxLOD;} void set (float value) {m_Desc.MaxLOD=value;}}

			internal:
				D3D11_SAMPLER_DESC m_Desc;
		};

		public ref class QueryDescription
		{
			public:
				QueryDescription ()
				{
					m_Desc.Query = D3D11_QUERY_EVENT;
					m_Desc.MiscFlags = 0;
				}

				property QueryType Query {QueryType get() {return (QueryType)m_Desc.Query;} void set (QueryType value) {m_Desc.Query=(D3D11_QUERY)value;}}
				property QueryMisc Misc {QueryMisc get() {return (QueryMisc)m_Desc.MiscFlags;} void set (QueryMisc value) {m_Desc.MiscFlags=(UINT)value;}}

			internal:
				D3D11_QUERY_DESC m_Desc;
		};

		public ref class CounterDescription
		{
			public:
				CounterDescription ()
				{
					m_Desc.Counter = D3D11_COUNTER_DEVICE_DEPENDENT_0;
					m_Desc.MiscFlags = 0;
				}

				property CounterType Counter {CounterType get() {return (CounterType)m_Desc.Counter;} void set (CounterType value) {m_Desc.Counter=(D3D11_COUNTER)value;}}
				property uint32 Misc {uint32 get() {return m_Desc.MiscFlags;} void set (uint32 value) {m_Desc.MiscFlags=value;}}

			internal:
				D3D11_COUNTER_DESC m_Desc;
		};

		public ref class Viewport sealed
		{
			public:
				Viewport ()
				{
					m_Viewport.TopLeftX = 0.0f;
					m_Viewport.TopLeftY = 0.0f;
					m_Viewport.Width = 0.0f;
					m_Viewport.Height = 0.0f;
					m_Viewport.MinDepth = 0.0f;
					m_Viewport.MaxDepth = 0.0f;
				}

				property float TopLeftX {float get() {return m_Viewport.TopLeftX;} void set (float value) {m_Viewport.TopLeftX=value;}}
				property float TopLeftY {float get() {return m_Viewport.TopLeftY;} void set (float value) {m_Viewport.TopLeftY=value;}}
				property float Width {float get() {return m_Viewport.Width;} void set (float value) {m_Viewport.Width=value;}}
				property float Height {float get() {return m_Viewport.Height;} void set (float value) {m_Viewport.Height=value;}}
				property float MinDepth {float get() {return m_Viewport.MinDepth;} void set (float value) {m_Viewport.MinDepth=value;}}
				property float MaxDepth {float get() {return m_Viewport.MaxDepth;} void set (float value) {m_Viewport.MaxDepth=value;}}

			internal:
				D3D11_VIEWPORT m_Viewport;
		};

		public ref class Rect sealed
		{
			public:
				Rect ()
				{
					m_Rect.left = 0;
					m_Rect.top = 0;
					m_Rect.right = 0;
					m_Rect.bottom = 0;
				}

				property int32 Left {int32 get() {return m_Rect.left;} void set (int32 value) {m_Rect.left=value;}}
				property int32 Top {int32 get() {return m_Rect.top;} void set (int32 value) {m_Rect.top=value;}}
				property int32 Right {int32 get() {return m_Rect.right;} void set (int32 value) {m_Rect.right=value;}}
				property int32 Bottom {int32 get() {return m_Rect.bottom;} void set (int32 value) {m_Rect.bottom=value;}}

			internal:
				D3D11_RECT m_Rect;
		};

		public ref class Box sealed
		{
			public:
				Box ()
				{
					m_Box.left = 0;
					m_Box.top = 0;
					m_Box.front = 0;
					m_Box.right = 0;
					m_Box.bottom = 0;
					m_Box.back = 0;
				}

				property int32 Left {int32 get() {return m_Box.left;} void set (int32 value) {m_Box.left=value;}}
				property int32 Top {int32 get() {return m_Box.top;} void set (int32 value) {m_Box.top=value;}}
				property int32 Front {int32 get() {return m_Box.front;} void set (int32 value) {m_Box.front=value;}}
				property int32 Right {int32 get() {return m_Box.right;} void set (int32 value) {m_Box.right=value;}}
				property int32 Bottom {int32 get() {return m_Box.bottom;} void set (int32 value) {m_Box.bottom=value;}}
				property int32 Back {int32 get() {return m_Box.back;} void set (int32 value) {m_Box.back=value;}}

			internal:
				D3D11_BOX m_Box;
		};


		
		public interface class IDeviceChild
		{
		public:
/*			virtual void STDMETHODCALLTYPE GetDevice( 
				_Out_  ID3D11Device **ppDevice) = 0;
        
			virtual HRESULT STDMETHODCALLTYPE GetPrivateData( 
				_In_  REFGUID guid,
				_Inout_  UINT *pDataSize,
				_Out_writes_bytes_opt_( *pDataSize )  void *pData) = 0;
        
			virtual HRESULT STDMETHODCALLTYPE SetPrivateData( 
				_In_  REFGUID guid,
				_In_  UINT DataSize,
				_In_reads_bytes_opt_( DataSize )  const void *pData) = 0;
        
			virtual HRESULT STDMETHODCALLTYPE SetPrivateDataInterface( 
				_In_  REFGUID guid,
				_In_opt_  const IUnknown *pData) = 0;*/
		};

		public interface class IAsynchronous : IDeviceChild
		{
			public:
				//virtual UINT STDMETHODCALLTYPE GetDataSize( void) = 0;
	    };

		public interface class IBlendState : IDeviceChild
		{
			public:
/*        virtual void STDMETHODCALLTYPE GetDesc( 
            _Out_  D3D11_BLEND_DESC *pDesc) = 0;*/
		};

		public interface class IBlendState1 : IBlendState
		{
			public:
/*        virtual void STDMETHODCALLTYPE GetDesc1( 
            _Out_  D3D11_BLEND_DESC1 *pDesc) = 0;*/
		};

		public interface class ICommandList : IDeviceChild
		{
			public:
			//virtual UINT STDMETHODCALLTYPE GetContextFlags( void) = 0;
		};

		public interface class ICounter : IAsynchronous
		{
			public:
/*				virtual void STDMETHODCALLTYPE GetDesc( 
				_Out_  D3D11_COUNTER_DESC *pDesc) = 0;*/
		};

		public interface class IDepthStencilState : IDeviceChild
		{
			public:
/*				virtual void STDMETHODCALLTYPE GetDesc( 
					_Out_  D3D11_DEPTH_STENCIL_DESC *pDesc) = 0;*/
		};

	public interface class IDeviceContextState : IDeviceChild
	{
	};

	public interface class IInputLayout : IDeviceChild
	{
	};

	public interface class IQuery : IAsynchronous
    {
    public:
        //virtual void STDMETHODCALLTYPE GetDesc( 
        //    /* [annotation] */ 
        //    _Out_  D3D11_QUERY_DESC *pDesc) = 0;
    };

	public interface class IPredicate : IQuery
    {
    };

	public interface class IRasterizerState : IDeviceChild
    {
    public:
        //virtual void STDMETHODCALLTYPE GetDesc( 
        //    /* [annotation] */ 
        //    _Out_  D3D11_RASTERIZER_DESC *pDesc) = 0;
    };

    public interface class IRasterizerState1 : IRasterizerState
    {
    public:
        //virtual void STDMETHODCALLTYPE GetDesc1( 
        //    /* [annotation] */ 
        //    _Out_  D3D11_RASTERIZER_DESC1 *pDesc) = 0;
    };

	public interface class ISamplerState : IDeviceChild
    {
    public:
        //virtual void STDMETHODCALLTYPE GetDesc( 
        //    /* [annotation] */ 
        //    _Out_  D3D11_SAMPLER_DESC *pDesc) = 0;
    };

    public interface class IResource : IDeviceChild
    {
		public:
			property ResourceDimension ResourceType {ResourceDimension get ();}
			property uint32 EvictionPriority {uint32 get (); void set (uint32 value);}
    };

	public interface class IView : IDeviceChild
    {
    public:
        //virtual void STDMETHODCALLTYPE GetResource( 
        //    /* [annotation] */ 
        //    _Out_  ID3D11Resource **ppResource) = 0;
        //
    };

    public interface class IBuffer : IResource
    {
		public:
			property uint32 ByteWidth {uint32 get();}
			property DX4WRT::Direct3D11::Usage Usage {DX4WRT::Direct3D11::Usage get();}
			property DX4WRT::Direct3D11::Bind Bind {DX4WRT::Direct3D11::Bind get();}
			property DX4WRT::Direct3D11::CPUAccess CPUAccess {DX4WRT::Direct3D11::CPUAccess get();}
			property DX4WRT::Direct3D11::ResourceMisc Misc {DX4WRT::Direct3D11::ResourceMisc get();}
			property uint32 StructureByteStride {uint32 get();}
    };

    public interface class IDepthStencilView : IView
    {
    public:
        //virtual void STDMETHODCALLTYPE GetDesc( 
        //    /* [annotation] */ 
        //    _Out_  D3D11_DEPTH_STENCIL_VIEW_DESC *pDesc) = 0;
        
    };

	public interface class IRenderTargetView : IView
    {
    public:
        //virtual void STDMETHODCALLTYPE GetDesc( 
        //    /* [annotation] */ 
        //    _Out_  D3D11_RENDER_TARGET_VIEW_DESC *pDesc) = 0;
        
    };

	public interface class IShaderResourceView : IView
	{

	};

	public interface class ITexture1D : IResource
	{
		property uint32 Width {uint32 get();}
		property uint32 MipLevels {uint32 get();}
		property uint32 ArraySize {uint32 get();}
		property DX4WRT::DXGI::Format Format {DX4WRT::DXGI::Format get();}
		property DX4WRT::Direct3D11::Usage Usage {DX4WRT::Direct3D11::Usage get();}
		property DX4WRT::Direct3D11::Bind Bind {DX4WRT::Direct3D11::Bind get();}
		property DX4WRT::Direct3D11::CPUAccess CPUAccess {DX4WRT::Direct3D11::CPUAccess get();}
		property DX4WRT::Direct3D11::ResourceMisc Misc {DX4WRT::Direct3D11::ResourceMisc get();}
	};

	public interface class ITexture2D : IResource
	{
		property uint32 Width {uint32 get();}
		property uint32 Height {uint32 get();}
		property uint32 MipLevels {uint32 get();}
		property uint32 ArraySize {uint32 get();}
		property DX4WRT::DXGI::Format Format {DX4WRT::DXGI::Format get();}
		property uint32 SampleCount {uint32 get();}
		property uint32 SampleQuality {uint32 get();}
		property DX4WRT::Direct3D11::Usage Usage {DX4WRT::Direct3D11::Usage get();}
		property DX4WRT::Direct3D11::Bind Bind {DX4WRT::Direct3D11::Bind get();}
		property DX4WRT::Direct3D11::CPUAccess CPUAccess {DX4WRT::Direct3D11::CPUAccess get();}
		property DX4WRT::Direct3D11::ResourceMisc Misc {DX4WRT::Direct3D11::ResourceMisc get();}
	};

	public interface class ITexture3D : IResource
	{
		property uint32 Width {uint32 get();}
		property uint32 Height {uint32 get();}
		property uint32 Depth {uint32 get();}
		property uint32 MipLevels {uint32 get();}
		property DX4WRT::DXGI::Format Format {DX4WRT::DXGI::Format get();}
		property DX4WRT::Direct3D11::Usage Usage {DX4WRT::Direct3D11::Usage get();}
		property DX4WRT::Direct3D11::Bind Bind {DX4WRT::Direct3D11::Bind get();}
		property DX4WRT::Direct3D11::CPUAccess CPUAccess {DX4WRT::Direct3D11::CPUAccess get();}
		property DX4WRT::Direct3D11::ResourceMisc Misc {DX4WRT::Direct3D11::ResourceMisc get();}
	};

	public interface class IUnorderedAccessView : IView
	{

	};

	public interface class IComputeShader : IDeviceChild
	{
	};

	public interface class IDomainShader : IDeviceChild
	{
	};

	public interface class IGeometryShader : IDeviceChild
	{
	};

	public interface class IHullShader : IDeviceChild
	{
	};

	public interface class IPixelShader : IDeviceChild
	{
	};

	public interface class IVertexShader : IDeviceChild
	{
	};

	public interface class IClassInstance : IDeviceChild
    {
    public:
        //virtual void STDMETHODCALLTYPE GetClassLinkage( 
        //    /* [annotation] */ 
        //    _Out_  ID3D11ClassLinkage **ppLinkage) = 0;
        //
        //virtual void STDMETHODCALLTYPE GetDesc( 
        //    /* [annotation] */ 
        //    _Out_  D3D11_CLASS_INSTANCE_DESC *pDesc) = 0;
        //
        //virtual void STDMETHODCALLTYPE GetInstanceName( 
        //    /* [annotation] */ 
        //    _Out_writes_opt_(*pBufferLength)  LPSTR pInstanceName,
        //    /* [annotation] */ 
        //    _Inout_  SIZE_T *pBufferLength) = 0;
        //
        //virtual void STDMETHODCALLTYPE GetTypeName( 
        //    /* [annotation] */ 
        //    _Out_writes_opt_(*pBufferLength)  LPSTR pTypeName,
        //    /* [annotation] */ 
        //    _Inout_  SIZE_T *pBufferLength) = 0;
        
    };

	public interface class IClassLinkage : IDeviceChild
    {
    public:
        //virtual HRESULT STDMETHODCALLTYPE GetClassInstance( 
        //    /* [annotation] */ 
        //    _In_  LPCSTR pClassInstanceName,
        //    /* [annotation] */ 
        //    _In_  UINT InstanceIndex,
        //    /* [annotation] */ 
        //    _Out_  ID3D11ClassInstance **ppInstance) = 0;
        //
        //virtual HRESULT STDMETHODCALLTYPE CreateClassInstance( 
        //    /* [annotation] */ 
        //    _In_  LPCSTR pClassTypeName,
        //    /* [annotation] */ 
        //    _In_  UINT ConstantBufferOffset,
        //    /* [annotation] */ 
        //    _In_  UINT ConstantVectorOffset,
        //    /* [annotation] */ 
        //    _In_  UINT TextureOffset,
        //    /* [annotation] */ 
        //    _In_  UINT SamplerOffset,
        //    /* [annotation] */ 
        //    _Out_  ID3D11ClassInstance **ppInstance) = 0;
        
    };

		public interface class IDeviceContext : IDeviceChild
	    {
			void VSSetConstantBuffers (uint32 startSlot, array<IBuffer^>^ constantBuffers);
			void PSSetShaderResources (uint32 startSlot, array<IShaderResourceView^>^ shaderResourceViews);
			void PSSetShader (IPixelShader^ pixelShader, array<IClassInstance^>^ classInstances);
			void PSSetSamplers (uint32 startSlot, array<ISamplerState^>^ samplerStates);
			void VSSetShader (IVertexShader^ vertexShader, array<IClassInstance^>^ classInstances);
			void DrawIndexed(uint32 indexCount, uint32 startIndexLocation, int32 baseVertexLocation);
			void Draw(uint32 indexCount, uint32 startIndexLocation);
    //public:
    //    virtual HRESULT STDMETHODCALLTYPE Map( 
    //        /* [annotation] */ 
    //        _In_  ID3D11Resource *pResource,
    //        /* [annotation] */ 
    //        _In_  UINT Subresource,
    //        /* [annotation] */ 
    //        _In_  D3D11_MAP MapType,
    //        /* [annotation] */ 
    //        _In_  UINT MapFlags,
    //        /* [annotation] */ 
    //        _Out_  D3D11_MAPPED_SUBRESOURCE *pMappedResource) = 0;
    //    
    //    virtual void STDMETHODCALLTYPE Unmap( 
    //        /* [annotation] */ 
    //        _In_  ID3D11Resource *pResource,
    //        /* [annotation] */ 
    //        _In_  UINT Subresource) = 0;
			void PSSetConstantBuffers (uint32 startSlot, array<IBuffer^>^ constantBuffers);
			void IASetInputLayout (IInputLayout^ inputLayout);
			void IASetVertexBuffers (uint32 startSlot, array<IBuffer^>^ vertexBuffers, array<uint32>^ strides, array<uint32>^ offsets);
			void IASetIndexBuffer (IBuffer^ indexBuffer, DX4WRT::DXGI::Format format, uint32 offset);
			void DrawIndexedInstanced(uint32 indexCountPerInstance, uint32 instanceCount, uint32 startIndexLocation, int32 baseVertexLocation, int32 startInstanceLocation);
			void DrawInstanced(uint32 vertexCountPerInstance,uint32 instanceCount, uint32 startVertexLocation, uint32 startInstanceLocation);
			void GSSetConstantBuffers (uint32 startSlot, array<IBuffer^>^ constantBuffers);
			void GSSetShader (IGeometryShader^ geometryShader, array<IClassInstance^>^ classInstances);
			void IASetPrimitiveTopology(PrimitiveTopology topology);
			void VSSetShaderResources (uint32 startSlot, array<IShaderResourceView^>^ shaderResourceViews);
			void VSSetSamplers (uint32 startSlot, array<ISamplerState^>^ samplerStates);
			void Begin (IAsynchronous^ async);
			void End (IAsynchronous^ async);
    //    virtual HRESULT STDMETHODCALLTYPE GetData( 
    //        /* [annotation] */ 
    //        _In_  ID3D11Asynchronous *pAsync,
    //        /* [annotation] */ 
    //        _Out_writes_bytes_opt_( DataSize )  void *pData,
    //        /* [annotation] */ 
    //        _In_  UINT DataSize,
    //        /* [annotation] */ 
    //        _In_  UINT GetDataFlags) = 0;
			void SetPredication (IPredicate^ predicate, bool predicateValue);
			void GSSetShaderResources (uint32 startSlot, array<IShaderResourceView^>^ shaderResourceViews);
			void GSSetSamplers (uint32 startSlot, array<ISamplerState^>^ samplerStates);
			void OMSetRenderTargets (array<IRenderTargetView^>^ renderTargetViews, IDepthStencilView^ depthStencilView);
			void OMSetRenderTargetsAndUnorderedAccessViews (array<IRenderTargetView^>^ renderTargetViews, IDepthStencilView^ depthStencilView, uint32 uAVStartSlot, array<IUnorderedAccessView^>^ unorderedAccessViews, array<uint32>^ uAVInitialCounts);
			void OMSetBlendState (IBlendState^ blendState, array<float>^ blendfactor, uint32 sampleMask);
			void OMSetDepthStencilState ( IDepthStencilState^ depthStencilState, uint32 stencilRef);
			void SOSetTargets (array<IBuffer^>^ targets, array<uint32>^ offsets);
			void DrawAuto ();
			void DrawIndexedInstancedIndirect (IBuffer^ bufferForArgs, uint32 alignedByteOffsetForArgs);
			void DrawInstancedIndirect (IBuffer^ bufferForArgs, uint32 alignedByteOffsetForArgs);
			void Dispatch (uint32 threadGroupCountX, uint32 threadGroupCountY, uint32 threadGroupCountZ);
			void DispatchIndirect (IBuffer^ bufferForArgs, uint32 alignedByteOffsetForArgs);
			void RSSetState (IRasterizerState^ rasterizerState);
			void RSSetViewports (array<Viewport^>^ viewports);
			void RSSetScissorRects (array<Rect^>^ rects);
			void CopySubresourceRegion (IResource^ destinationResource, uint32 destinationSubresource, uint32 destinationX, uint32 destinationY, uint32 destinationZ, IResource^ sourceResource, uint32 sourceSubresource, Box^ sourceBox);
    		void CopyResource (IResource^ destinationResource, IResource^ sourceResource);
			void UpdateSubresource (IResource^ destinationResource, uint32 destinationSubresource, Box^ destinationBox, array<uint8>^ sourceData, uint32 sourceRowPitch, uint32 sourceDepthPitch);
			void CopyStructureCount (IBuffer^ destinationBuffer, uint32 destinationalignedByteOffset, IUnorderedAccessView^ sourceView);
			void ClearRenderTargetView (IRenderTargetView^ rendertTargetView, array<float>^ colorRGBA);
			void ClearUnorderedAccessViewUint (IUnorderedAccessView^ unorderedAccessView, array<uint32>^ values);
			void ClearUnorderedAccessViewFloat (IUnorderedAccessView^ unorderedAccessView, array<float>^ values);
			void ClearDepthStencilView (IDepthStencilView^ depthStencilView, Clear clear, float depth, uint8 stencil);
			void GenerateMips (IShaderResourceView^ shaderResourceView);
			void SetResourceMinLOD (IResource^ resource, float minLOD);
			float GetResourceMinLOD (IResource^ resource);
			void ResolveSubresource (IResource^ destionationResource, uint32 destinationSubresource, IResource^ sourceResource, uint32 sourceSubresource, DXGI::Format format);
			void ExecuteCommandList(ICommandList^ commandList, bool restoreContextState);
			void HSSetShaderResources (uint32 startSlot, array<IShaderResourceView^>^ shaderResourceViews);
			void HSSetShader (IHullShader^ hullShader, array<IClassInstance^>^ classInstances);
			void HSSetSamplers (uint32 startSlot, array<ISamplerState^>^ samplerStates);
			void HSSetConstantBuffers (uint32 startSlot, array<IBuffer^>^ constantBuffers);
			void DSSetShaderResources (uint32 startSlot, array<IShaderResourceView^>^ shaderResourceViews);
			void DSSetShader (IDomainShader^ domainShader, array<IClassInstance^>^ classInstances);
			void DSSetSamplers (uint32 startSlot, array<ISamplerState^>^ samplerStates);
			void DSSetConstantBuffers (uint32 startSlot, array<IBuffer^>^ constantBuffers);
			void CSSetShaderResources (uint32 startSlot, array<IShaderResourceView^>^ shaderResourceViews);
			void CSSetUnorderedAccessViews(uint32 startSlot, array<IUnorderedAccessView^>^ unorderedAccessViews, array<uint32>^ uAVInitialCounts);
			void CSSetShader (IComputeShader^ computeShader, array<IClassInstance^>^ classInstances);
			void CSSetSamplers (uint32 startSlot, array<ISamplerState^>^ samplerStates);
			void CSSetConstantBuffers (uint32 startSlot, array<IBuffer^>^ constantBuffers);

    

			    
    //    virtual void STDMETHODCALLTYPE VSGetConstantBuffers( 
    //        /* [annotation] */ 
    //        _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 )  UINT StartSlot,
    //        /* [annotation] */ 
    //        _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot )  UINT NumBuffers,
    //        /* [annotation] */ 
    //        _Out_writes_opt_(NumBuffers)  ID3D11Buffer **ppConstantBuffers) = 0;
    //    
    //    virtual void STDMETHODCALLTYPE PSGetShaderResources( 
    //        /* [annotation] */ 
    //        _In_range_( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 )  UINT StartSlot,
    //        /* [annotation] */ 
    //        _In_range_( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot )  UINT NumViews,
    //        /* [annotation] */ 
    //        _Out_writes_opt_(NumViews)  ID3D11ShaderResourceView **ppShaderResourceViews) = 0;
    //    
    //    virtual void STDMETHODCALLTYPE PSGetShader( 
    //        /* [annotation] */ 
    //        _Out_  ID3D11PixelShader **ppPixelShader,
    //        /* [annotation] */ 
    //        _Out_writes_opt_(*pNumClassInstances)  ID3D11ClassInstance **ppClassInstances,
    //        /* [annotation] */ 
    //        _Inout_opt_  UINT *pNumClassInstances) = 0;
    //    
    //    virtual void STDMETHODCALLTYPE PSGetSamplers( 
    //        /* [annotation] */ 
    //        _In_range_( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 )  UINT StartSlot,
    //        /* [annotation] */ 
    //        _In_range_( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot )  UINT NumSamplers,
    //        /* [annotation] */ 
    //        _Out_writes_opt_(NumSamplers)  ID3D11SamplerState **ppSamplers) = 0;
    //    
    //    virtual void STDMETHODCALLTYPE VSGetShader( 
    //        /* [annotation] */ 
    //        _Out_  ID3D11VertexShader **ppVertexShader,
    //        /* [annotation] */ 
    //        _Out_writes_opt_(*pNumClassInstances)  ID3D11ClassInstance **ppClassInstances,
    //        /* [annotation] */ 
    //        _Inout_opt_  UINT *pNumClassInstances) = 0;
    //    
    //    virtual void STDMETHODCALLTYPE PSGetConstantBuffers( 
    //        /* [annotation] */ 
    //        _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 )  UINT StartSlot,
    //        /* [annotation] */ 
    //        _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot )  UINT NumBuffers,
    //        /* [annotation] */ 
    //        _Out_writes_opt_(NumBuffers)  ID3D11Buffer **ppConstantBuffers) = 0;
    //    
    //    virtual void STDMETHODCALLTYPE IAGetInputLayout( 
    //        /* [annotation] */ 
    //        _Out_  ID3D11InputLayout **ppInputLayout) = 0;
    //    
    //    virtual void STDMETHODCALLTYPE IAGetVertexBuffers( 
    //        /* [annotation] */ 
    //        _In_range_( 0, D3D11_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT - 1 )  UINT StartSlot,
    //        /* [annotation] */ 
    //        _In_range_( 0, D3D11_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT - StartSlot )  UINT NumBuffers,
    //        /* [annotation] */ 
    //        _Out_writes_opt_(NumBuffers)  ID3D11Buffer **ppVertexBuffers,
    //        /* [annotation] */ 
    //        _Out_writes_opt_(NumBuffers)  UINT *pStrides,
    //        /* [annotation] */ 
    //        _Out_writes_opt_(NumBuffers)  UINT *pOffsets) = 0;
    //    
    //    virtual void STDMETHODCALLTYPE IAGetIndexBuffer( 
    //        /* [annotation] */ 
    //        _Out_opt_  ID3D11Buffer **pIndexBuffer,
    //        /* [annotation] */ 
    //        _Out_opt_  DXGI_FORMAT *Format,
    //        /* [annotation] */ 
    //        _Out_opt_  UINT *Offset) = 0;
    //    
    //    virtual void STDMETHODCALLTYPE GSGetConstantBuffers( 
    //        /* [annotation] */ 
    //        _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 )  UINT StartSlot,
    //        /* [annotation] */ 
    //        _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot )  UINT NumBuffers,
    //        /* [annotation] */ 
    //        _Out_writes_opt_(NumBuffers)  ID3D11Buffer **ppConstantBuffers) = 0;
    //    
    //    virtual void STDMETHODCALLTYPE GSGetShader( 
    //        /* [annotation] */ 
    //        _Out_  ID3D11GeometryShader **ppGeometryShader,
    //        /* [annotation] */ 
    //        _Out_writes_opt_(*pNumClassInstances)  ID3D11ClassInstance **ppClassInstances,
    //        /* [annotation] */ 
    //        _Inout_opt_  UINT *pNumClassInstances) = 0;
    //    
    //    virtual void STDMETHODCALLTYPE IAGetPrimitiveTopology( 
    //        /* [annotation] */ 
    //        _Out_  D3D11_PRIMITIVE_TOPOLOGY *pTopology) = 0;
    //    
    //    virtual void STDMETHODCALLTYPE VSGetShaderResources( 
    //        /* [annotation] */ 
    //        _In_range_( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 )  UINT StartSlot,
    //        /* [annotation] */ 
    //        _In_range_( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot )  UINT NumViews,
    //        /* [annotation] */ 
    //        _Out_writes_opt_(NumViews)  ID3D11ShaderResourceView **ppShaderResourceViews) = 0;
    //    
    //    virtual void STDMETHODCALLTYPE VSGetSamplers( 
    //        /* [annotation] */ 
    //        _In_range_( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 )  UINT StartSlot,
    //        /* [annotation] */ 
    //        _In_range_( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot )  UINT NumSamplers,
    //        /* [annotation] */ 
    //        _Out_writes_opt_(NumSamplers)  ID3D11SamplerState **ppSamplers) = 0;
    //    
    //    virtual void STDMETHODCALLTYPE GetPredication( 
    //        /* [annotation] */ 
    //        _Out_opt_  ID3D11Predicate **ppPredicate,
    //        /* [annotation] */ 
    //        _Out_opt_  BOOL *pPredicateValue) = 0;
    //    
    //    virtual void STDMETHODCALLTYPE GSGetShaderResources( 
    //        /* [annotation] */ 
    //        _In_range_( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 )  UINT StartSlot,
    //        /* [annotation] */ 
    //        _In_range_( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot )  UINT NumViews,
    //        /* [annotation] */ 
    //        _Out_writes_opt_(NumViews)  ID3D11ShaderResourceView **ppShaderResourceViews) = 0;
    //    
    //    virtual void STDMETHODCALLTYPE GSGetSamplers( 
    //        /* [annotation] */ 
    //        _In_range_( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 )  UINT StartSlot,
    //        /* [annotation] */ 
    //        _In_range_( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot )  UINT NumSamplers,
    //        /* [annotation] */ 
    //        _Out_writes_opt_(NumSamplers)  ID3D11SamplerState **ppSamplers) = 0;
    //    
    //    virtual void STDMETHODCALLTYPE OMGetRenderTargets( 
    //        /* [annotation] */ 
    //        _In_range_( 0, D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT )  UINT NumViews,
    //        /* [annotation] */ 
    //        _Out_writes_opt_(NumViews)  ID3D11RenderTargetView **ppRenderTargetViews,
    //        /* [annotation] */ 
    //        _Out_opt_  ID3D11DepthStencilView **ppDepthStencilView) = 0;
    //    
    //    virtual void STDMETHODCALLTYPE OMGetRenderTargetsAndUnorderedAccessViews( 
    //        /* [annotation] */ 
    //        _In_range_( 0, D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT )  UINT NumRTVs,
    //        /* [annotation] */ 
    //        _Out_writes_opt_(NumRTVs)  ID3D11RenderTargetView **ppRenderTargetViews,
    //        /* [annotation] */ 
    //        _Out_opt_  ID3D11DepthStencilView **ppDepthStencilView,
    //        /* [annotation] */ 
    //        _In_range_( 0, D3D11_PS_CS_UAV_REGISTER_COUNT - 1 )  UINT UAVStartSlot,
    //        /* [annotation] */ 
    //        _In_range_( 0, D3D11_PS_CS_UAV_REGISTER_COUNT - UAVStartSlot )  UINT NumUAVs,
    //        /* [annotation] */ 
    //        _Out_writes_opt_(NumUAVs)  ID3D11UnorderedAccessView **ppUnorderedAccessViews) = 0;
    //    
    //    virtual void STDMETHODCALLTYPE OMGetBlendState( 
    //        /* [annotation] */ 
    //        _Out_opt_  ID3D11BlendState **ppBlendState,
    //        /* [annotation] */ 
    //        _Out_opt_  FLOAT BlendFactor[ 4 ],
    //        /* [annotation] */ 
    //        _Out_opt_  UINT *pSampleMask) = 0;
    //    
    //    virtual void STDMETHODCALLTYPE OMGetDepthStencilState( 
    //        /* [annotation] */ 
    //        _Out_opt_  ID3D11DepthStencilState **ppDepthStencilState,
    //        /* [annotation] */ 
    //        _Out_opt_  UINT *pStencilRef) = 0;
    //    
    //    virtual void STDMETHODCALLTYPE SOGetTargets( 
    //        /* [annotation] */ 
    //        _In_range_( 0, D3D11_SO_BUFFER_SLOT_COUNT )  UINT NumBuffers,
    //        /* [annotation] */ 
    //        _Out_writes_opt_(NumBuffers)  ID3D11Buffer **ppSOTargets) = 0;
    //    
    //    virtual void STDMETHODCALLTYPE RSGetState( 
    //        /* [annotation] */ 
    //        _Out_  ID3D11RasterizerState **ppRasterizerState) = 0;
    //    
    //    virtual void STDMETHODCALLTYPE RSGetViewports( 
    //        /* [annotation] */ 
    //        _Inout_ /*_range(0, D3D11_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE )*/   UINT *pNumViewports,
    //        /* [annotation] */ 
    //        _Out_writes_opt_(*pNumViewports)  D3D11_VIEWPORT *pViewports) = 0;
    //    
    //    virtual void STDMETHODCALLTYPE RSGetScissorRects( 
    //        /* [annotation] */ 
    //        _Inout_ /*_range(0, D3D11_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE )*/   UINT *pNumRects,
    //        /* [annotation] */ 
    //        _Out_writes_opt_(*pNumRects)  D3D11_RECT *pRects) = 0;
    //    
    //    virtual void STDMETHODCALLTYPE HSGetShaderResources( 
    //        /* [annotation] */ 
    //        _In_range_( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 )  UINT StartSlot,
    //        /* [annotation] */ 
    //        _In_range_( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot )  UINT NumViews,
    //        /* [annotation] */ 
    //        _Out_writes_opt_(NumViews)  ID3D11ShaderResourceView **ppShaderResourceViews) = 0;
    //    
    //    virtual void STDMETHODCALLTYPE HSGetShader( 
    //        /* [annotation] */ 
    //        _Out_  ID3D11HullShader **ppHullShader,
    //        /* [annotation] */ 
    //        _Out_writes_opt_(*pNumClassInstances)  ID3D11ClassInstance **ppClassInstances,
    //        /* [annotation] */ 
    //        _Inout_opt_  UINT *pNumClassInstances) = 0;
    //    
    //    virtual void STDMETHODCALLTYPE HSGetSamplers( 
    //        /* [annotation] */ 
    //        _In_range_( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 )  UINT StartSlot,
    //        /* [annotation] */ 
    //        _In_range_( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot )  UINT NumSamplers,
    //        /* [annotation] */ 
    //        _Out_writes_opt_(NumSamplers)  ID3D11SamplerState **ppSamplers) = 0;
    //    
    //    virtual void STDMETHODCALLTYPE HSGetConstantBuffers( 
    //        /* [annotation] */ 
    //        _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 )  UINT StartSlot,
    //        /* [annotation] */ 
    //        _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot )  UINT NumBuffers,
    //        /* [annotation] */ 
    //        _Out_writes_opt_(NumBuffers)  ID3D11Buffer **ppConstantBuffers) = 0;
    //    
    //    virtual void STDMETHODCALLTYPE DSGetShaderResources( 
    //        /* [annotation] */ 
    //        _In_range_( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 )  UINT StartSlot,
    //        /* [annotation] */ 
    //        _In_range_( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot )  UINT NumViews,
    //        /* [annotation] */ 
    //        _Out_writes_opt_(NumViews)  ID3D11ShaderResourceView **ppShaderResourceViews) = 0;
    //    
    //    virtual void STDMETHODCALLTYPE DSGetShader( 
    //        /* [annotation] */ 
    //        _Out_  ID3D11DomainShader **ppDomainShader,
    //        /* [annotation] */ 
    //        _Out_writes_opt_(*pNumClassInstances)  ID3D11ClassInstance **ppClassInstances,
    //        /* [annotation] */ 
    //        _Inout_opt_  UINT *pNumClassInstances) = 0;
    //    
    //    virtual void STDMETHODCALLTYPE DSGetSamplers( 
    //        /* [annotation] */ 
    //        _In_range_( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 )  UINT StartSlot,
    //        /* [annotation] */ 
    //        _In_range_( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot )  UINT NumSamplers,
    //        /* [annotation] */ 
    //        _Out_writes_opt_(NumSamplers)  ID3D11SamplerState **ppSamplers) = 0;
    //    
    //    virtual void STDMETHODCALLTYPE DSGetConstantBuffers( 
    //        /* [annotation] */ 
    //        _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 )  UINT StartSlot,
    //        /* [annotation] */ 
    //        _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot )  UINT NumBuffers,
    //        /* [annotation] */ 
    //        _Out_writes_opt_(NumBuffers)  ID3D11Buffer **ppConstantBuffers) = 0;
    //    
    //    virtual void STDMETHODCALLTYPE CSGetShaderResources( 
    //        /* [annotation] */ 
    //        _In_range_( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 )  UINT StartSlot,
    //        /* [annotation] */ 
    //        _In_range_( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot )  UINT NumViews,
    //        /* [annotation] */ 
    //        _Out_writes_opt_(NumViews)  ID3D11ShaderResourceView **ppShaderResourceViews) = 0;
    //    
    //    virtual void STDMETHODCALLTYPE CSGetUnorderedAccessViews( 
    //        /* [annotation] */ 
    //        _In_range_( 0, D3D11_PS_CS_UAV_REGISTER_COUNT - 1 )  UINT StartSlot,
    //        /* [annotation] */ 
    //        _In_range_( 0, D3D11_PS_CS_UAV_REGISTER_COUNT - StartSlot )  UINT NumUAVs,
    //        /* [annotation] */ 
    //        _Out_writes_opt_(NumUAVs)  ID3D11UnorderedAccessView **ppUnorderedAccessViews) = 0;
    //    
    //    virtual void STDMETHODCALLTYPE CSGetShader( 
    //        /* [annotation] */ 
    //        _Out_  ID3D11ComputeShader **ppComputeShader,
    //        /* [annotation] */ 
    //        _Out_writes_opt_(*pNumClassInstances)  ID3D11ClassInstance **ppClassInstances,
    //        /* [annotation] */ 
    //        _Inout_opt_  UINT *pNumClassInstances) = 0;
    //    
    //    virtual void STDMETHODCALLTYPE CSGetSamplers( 
    //        /* [annotation] */ 
    //        _In_range_( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 )  UINT StartSlot,
    //        /* [annotation] */ 
    //        _In_range_( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot )  UINT NumSamplers,
    //        /* [annotation] */ 
    //        _Out_writes_opt_(NumSamplers)  ID3D11SamplerState **ppSamplers) = 0;
    //    
    //    virtual void STDMETHODCALLTYPE CSGetConstantBuffers( 
    //        /* [annotation] */ 
    //        _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 )  UINT StartSlot,
    //        /* [annotation] */ 
    //        _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot )  UINT NumBuffers,
    //        /* [annotation] */ 
    //        _Out_writes_opt_(NumBuffers)  ID3D11Buffer **ppConstantBuffers) = 0;
		ICommandList^ FinishCommandList (bool restoreDeferredContextState);
		void ClearState ();
		void Flush ();
		property DeviceContextType Type { DeviceContextType get();}
		property uint32 ContextFlags { uint32 get();}
    };

		public interface class IDeviceContext1 : public IDeviceContext
    {
    public:
        //virtual void STDMETHODCALLTYPE CopySubresourceRegion1( 
        //    /* [annotation] */ 
        //    _In_  ID3D11Resource *pDstResource,
        //    /* [annotation] */ 
        //    _In_  UINT DstSubresource,
        //    /* [annotation] */ 
        //    _In_  UINT DstX,
        //    /* [annotation] */ 
        //    _In_  UINT DstY,
        //    /* [annotation] */ 
        //    _In_  UINT DstZ,
        //    /* [annotation] */ 
        //    _In_  ID3D11Resource *pSrcResource,
        //    /* [annotation] */ 
        //    _In_  UINT SrcSubresource,
        //    /* [annotation] */ 
        //    _In_opt_  const D3D11_BOX *pSrcBox,
        //    /* [annotation] */ 
        //    _In_  UINT CopyFlags) = 0;
        //
        //virtual void STDMETHODCALLTYPE UpdateSubresource1( 
        //    /* [annotation] */ 
        //    _In_  ID3D11Resource *pDstResource,
        //    /* [annotation] */ 
        //    _In_  UINT DstSubresource,
        //    /* [annotation] */ 
        //    _In_opt_  const D3D11_BOX *pDstBox,
        //    /* [annotation] */ 
        //    _In_  const void *pSrcData,
        //    /* [annotation] */ 
        //    _In_  UINT SrcRowPitch,
        //    /* [annotation] */ 
        //    _In_  UINT SrcDepthPitch,
        //    /* [annotation] */ 
        //    _In_  UINT CopyFlags) = 0;
        //
        //virtual void STDMETHODCALLTYPE DiscardResource( 
        //    /* [annotation] */ 
        //    _In_  ID3D11Resource *pResource) = 0;
        //
        //virtual void STDMETHODCALLTYPE DiscardView( 
        //    /* [annotation] */ 
        //    _In_  ID3D11View *pResourceView) = 0;
        //
        //virtual void STDMETHODCALLTYPE VSSetConstantBuffers1( 
        //    /* [annotation] */ 
        //    _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 )  UINT StartSlot,
        //    /* [annotation] */ 
        //    _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot )  UINT NumBuffers,
        //    /* [annotation] */ 
        //    _In_reads_opt_(NumBuffers)  ID3D11Buffer *const *ppConstantBuffers,
        //    /* [annotation] */ 
        //    _In_reads_opt_(NumBuffers)  const UINT *pFirstConstant,
        //    /* [annotation] */ 
        //    _In_reads_opt_(NumBuffers)  const UINT *pNumConstants) = 0;
        //
        //virtual void STDMETHODCALLTYPE HSSetConstantBuffers1( 
        //    /* [annotation] */ 
        //    _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 )  UINT StartSlot,
        //    /* [annotation] */ 
        //    _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot )  UINT NumBuffers,
        //    /* [annotation] */ 
        //    _In_reads_opt_(NumBuffers)  ID3D11Buffer *const *ppConstantBuffers,
        //    /* [annotation] */ 
        //    _In_reads_opt_(NumBuffers)  const UINT *pFirstConstant,
        //    /* [annotation] */ 
        //    _In_reads_opt_(NumBuffers)  const UINT *pNumConstants) = 0;
        //
        //virtual void STDMETHODCALLTYPE DSSetConstantBuffers1( 
        //    /* [annotation] */ 
        //    _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 )  UINT StartSlot,
        //    /* [annotation] */ 
        //    _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot )  UINT NumBuffers,
        //    /* [annotation] */ 
        //    _In_reads_opt_(NumBuffers)  ID3D11Buffer *const *ppConstantBuffers,
        //    /* [annotation] */ 
        //    _In_reads_opt_(NumBuffers)  const UINT *pFirstConstant,
        //    /* [annotation] */ 
        //    _In_reads_opt_(NumBuffers)  const UINT *pNumConstants) = 0;
        //
        //virtual void STDMETHODCALLTYPE GSSetConstantBuffers1( 
        //    /* [annotation] */ 
        //    _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 )  UINT StartSlot,
        //    /* [annotation] */ 
        //    _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot )  UINT NumBuffers,
        //    /* [annotation] */ 
        //    _In_reads_opt_(NumBuffers)  ID3D11Buffer *const *ppConstantBuffers,
        //    /* [annotation] */ 
        //    _In_reads_opt_(NumBuffers)  const UINT *pFirstConstant,
        //    /* [annotation] */ 
        //    _In_reads_opt_(NumBuffers)  const UINT *pNumConstants) = 0;
        //
        //virtual void STDMETHODCALLTYPE PSSetConstantBuffers1( 
        //    /* [annotation] */ 
        //    _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 )  UINT StartSlot,
        //    /* [annotation] */ 
        //    _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot )  UINT NumBuffers,
        //    /* [annotation] */ 
        //    _In_reads_opt_(NumBuffers)  ID3D11Buffer *const *ppConstantBuffers,
        //    /* [annotation] */ 
        //    _In_reads_opt_(NumBuffers)  const UINT *pFirstConstant,
        //    /* [annotation] */ 
        //    _In_reads_opt_(NumBuffers)  const UINT *pNumConstants) = 0;
        //
        //virtual void STDMETHODCALLTYPE CSSetConstantBuffers1( 
        //    /* [annotation] */ 
        //    _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 )  UINT StartSlot,
        //    /* [annotation] */ 
        //    _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot )  UINT NumBuffers,
        //    /* [annotation] */ 
        //    _In_reads_opt_(NumBuffers)  ID3D11Buffer *const *ppConstantBuffers,
        //    /* [annotation] */ 
        //    _In_reads_opt_(NumBuffers)  const UINT *pFirstConstant,
        //    /* [annotation] */ 
        //    _In_reads_opt_(NumBuffers)  const UINT *pNumConstants) = 0;
        //
        //virtual void STDMETHODCALLTYPE VSGetConstantBuffers1( 
        //    /* [annotation] */ 
        //    _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 )  UINT StartSlot,
        //    /* [annotation] */ 
        //    _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot )  UINT NumBuffers,
        //    /* [annotation] */ 
        //    _Out_writes_opt_(NumBuffers)  ID3D11Buffer **ppConstantBuffers,
        //    /* [annotation] */ 
        //    _Out_writes_opt_(NumBuffers)  UINT *pFirstConstant,
        //    /* [annotation] */ 
        //    _Out_writes_opt_(NumBuffers)  UINT *pNumConstants) = 0;
        //
        //virtual void STDMETHODCALLTYPE HSGetConstantBuffers1( 
        //    /* [annotation] */ 
        //    _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 )  UINT StartSlot,
        //    /* [annotation] */ 
        //    _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot )  UINT NumBuffers,
        //    /* [annotation] */ 
        //    _Out_writes_opt_(NumBuffers)  ID3D11Buffer **ppConstantBuffers,
        //    /* [annotation] */ 
        //    _Out_writes_opt_(NumBuffers)  UINT *pFirstConstant,
        //    /* [annotation] */ 
        //    _Out_writes_opt_(NumBuffers)  UINT *pNumConstants) = 0;
        //
        //virtual void STDMETHODCALLTYPE DSGetConstantBuffers1( 
        //    /* [annotation] */ 
        //    _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 )  UINT StartSlot,
        //    /* [annotation] */ 
        //    _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot )  UINT NumBuffers,
        //    /* [annotation] */ 
        //    _Out_writes_opt_(NumBuffers)  ID3D11Buffer **ppConstantBuffers,
        //    /* [annotation] */ 
        //    _Out_writes_opt_(NumBuffers)  UINT *pFirstConstant,
        //    /* [annotation] */ 
        //    _Out_writes_opt_(NumBuffers)  UINT *pNumConstants) = 0;
        //
        //virtual void STDMETHODCALLTYPE GSGetConstantBuffers1( 
        //    /* [annotation] */ 
        //    _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 )  UINT StartSlot,
        //    /* [annotation] */ 
        //    _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot )  UINT NumBuffers,
        //    /* [annotation] */ 
        //    _Out_writes_opt_(NumBuffers)  ID3D11Buffer **ppConstantBuffers,
        //    /* [annotation] */ 
        //    _Out_writes_opt_(NumBuffers)  UINT *pFirstConstant,
        //    /* [annotation] */ 
        //    _Out_writes_opt_(NumBuffers)  UINT *pNumConstants) = 0;
        //
        //virtual void STDMETHODCALLTYPE PSGetConstantBuffers1( 
        //    /* [annotation] */ 
        //    _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 )  UINT StartSlot,
        //    /* [annotation] */ 
        //    _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot )  UINT NumBuffers,
        //    /* [annotation] */ 
        //    _Out_writes_opt_(NumBuffers)  ID3D11Buffer **ppConstantBuffers,
        //    /* [annotation] */ 
        //    _Out_writes_opt_(NumBuffers)  UINT *pFirstConstant,
        //    /* [annotation] */ 
        //    _Out_writes_opt_(NumBuffers)  UINT *pNumConstants) = 0;
        //
        //virtual void STDMETHODCALLTYPE CSGetConstantBuffers1( 
        //    /* [annotation] */ 
        //    _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 )  UINT StartSlot,
        //    /* [annotation] */ 
        //    _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot )  UINT NumBuffers,
        //    /* [annotation] */ 
        //    _Out_writes_opt_(NumBuffers)  ID3D11Buffer **ppConstantBuffers,
        //    /* [annotation] */ 
        //    _Out_writes_opt_(NumBuffers)  UINT *pFirstConstant,
        //    /* [annotation] */ 
        //    _Out_writes_opt_(NumBuffers)  UINT *pNumConstants) = 0;
        //
        //virtual void STDMETHODCALLTYPE SwapDeviceContextState( 
        //    /* [annotation] */ 
        //    _In_  ID3DDeviceContextState *pState,
        //    /* [annotation] */ 
        //    _Out_opt_  ID3DDeviceContextState **ppPreviousState) = 0;
        //
        //virtual void STDMETHODCALLTYPE ClearView( 
        //    /* [annotation] */ 
        //    _In_  ID3D11View *pView,
        //    /* [annotation] */ 
        //    _In_  const FLOAT Color[ 4 ],
        //    /* [annotation] */ 
        //    _In_reads_opt_(NumRects)  const D3D11_RECT *pRect,
        //    UINT NumRects) = 0;
    };

		public interface class IDevice
		{
			IBuffer^ CreateBuffer (BufferDescription^ description, SubresourceData^ initialData);
			ITexture1D^ CreateTexture1D(Texture1DDescription^ description, array<SubresourceData^>^ initialData); 
			ITexture2D^ CreateTexture2D(Texture2DDescription^ description, array<SubresourceData^>^ initialData); 
			ITexture3D^ CreateTexture3D(Texture3DDescription^ description, array<SubresourceData^>^ initialData);
			IShaderResourceView^ CreateShaderResourceView (IResource^ resource, ShaderResourceViewDescription^ description);
			IUnorderedAccessView^ CreateUnorderedAccessView (IResource^ resource, UnorderedAccessViewDescription^ description);
			IRenderTargetView^ CreateRenderTargetView (IResource^ resource, RenderTargetViewDescription^ description);
			IDepthStencilView^ CreateDepthStencilView (IResource^ resource, DepthStencilViewDescription^ description);
			IInputLayout^ CreateInputLayout (array<InputElementDescription^>^ inputElementDescriptions, array<uint8>^shaderBytecodeWithInputSignature);
			IVertexShader^ CreateVertexShader (array<uint8>^ shaderBytecode, IClassLinkage^ classLinkage);
			IGeometryShader^ CreateGeometryShader (array<uint8>^ shaderBytecode, IClassLinkage^ classLinkage);
			IGeometryShader^ CreateGeometryShaderWithStreamOutput (array<uint8>^ shaderBytecode, array<StreamOutDeclarationEntry^>^ streamOutDeclaration, array<uint32>^ bufferStrides,  uint32 rasterizedStream, IClassLinkage^ classLinkage);
			IPixelShader^ CreatePixelShader (array<uint8>^ shaderBytecode, IClassLinkage^ classLinkage);
			IHullShader^ CreateHullShader (array<uint8>^ shaderBytecode, IClassLinkage^ classLinkage);
			IDomainShader^ CreateDomainShader (array<uint8>^ shaderBytecode, IClassLinkage^ classLinkage);
			IComputeShader^ CreateComputeShader (array<uint8>^ shaderBytecode, IClassLinkage^ classLinkage);
			IClassLinkage^ CreateClassLinkage ();
			IBlendState^ CreateBlendState (BlendDescription^ description);
			IDepthStencilState^ CreateDepthStencilState (DepthStencilDescription^ description);
			IRasterizerState^ CreateRasterizerState (RasterizerDescription^ description);
			ISamplerState^ CreateSamplerState (SamplerDescription^ description);
			IQuery^ CreateQuery (QueryDescription^ description);
			IPredicate^ CreatePredicate (QueryDescription^ description);
			ICounter^ CreateCounter (CounterDescription^ description);
			IDeviceContext^ CreateDeferredContext (uint32 contextFlags);


        //virtual HRESULT STDMETHODCALLTYPE OpenSharedResource( 
        //    /* [annotation] */ 
        //    _In_  HANDLE hResource,
        //    /* [annotation] */ 
        //    _In_  REFIID ReturnedInterface,
        //    /* [annotation] */ 
        //    _Out_opt_  void **ppResource) = 0;
        //
        //virtual HRESULT STDMETHODCALLTYPE CheckFormatSupport( 
        //    /* [annotation] */ 
        //    _In_  DXGI_FORMAT Format,
        //    /* [annotation] */ 
        //    _Out_  UINT *pFormatSupport) = 0;
        //
		uint32 CheckMultisampleQualityLevels (DX4WRT::DXGI::Format format, uint32 sampleCount);
        //
        //virtual void STDMETHODCALLTYPE CheckCounterInfo( 
        //    /* [annotation] */ 
        //    _Out_  D3D11_COUNTER_INFO *pCounterInfo) = 0;
        //
        //virtual HRESULT STDMETHODCALLTYPE CheckCounter( 
        //    /* [annotation] */ 
        //    _In_  const D3D11_COUNTER_DESC *pDesc,
        //    /* [annotation] */ 
        //    _Out_  D3D11_COUNTER_TYPE *pType,
        //    /* [annotation] */ 
        //    _Out_  UINT *pActiveCounters,
        //    /* [annotation] */ 
        //    _Out_writes_opt_(*pNameLength)  LPSTR szName,
        //    /* [annotation] */ 
        //    _Inout_opt_  UINT *pNameLength,
        //    /* [annotation] */ 
        //    _Out_writes_opt_(*pUnitsLength)  LPSTR szUnits,
        //    /* [annotation] */ 
        //    _Inout_opt_  UINT *pUnitsLength,
        //    /* [annotation] */ 
        //    _Out_writes_opt_(*pDescriptionLength)  LPSTR szDescription,
        //    /* [annotation] */ 
        //    _Inout_opt_  UINT *pDescriptionLength) = 0;
        //
        //virtual HRESULT STDMETHODCALLTYPE CheckFeatureSupport( 
        //    D3D11_FEATURE Feature,
        //    /* [annotation] */ 
        //    _Out_writes_bytes_(FeatureSupportDataSize)  void *pFeatureSupportData,
        //    UINT FeatureSupportDataSize) = 0;
        //
        //virtual HRESULT STDMETHODCALLTYPE GetPrivateData( 
        //    /* [annotation] */ 
        //    _In_  REFGUID guid,
        //    /* [annotation] */ 
        //    _Inout_  UINT *pDataSize,
        //    /* [annotation] */ 
        //    _Out_writes_bytes_opt_(*pDataSize)  void *pData) = 0;
        //
        //virtual HRESULT STDMETHODCALLTYPE SetPrivateData( 
        //    /* [annotation] */ 
        //    _In_  REFGUID guid,
        //    /* [annotation] */ 
        //    _In_  UINT DataSize,
        //    /* [annotation] */ 
        //    _In_reads_bytes_opt_(DataSize)  const void *pData) = 0;
        //
        //virtual HRESULT STDMETHODCALLTYPE SetPrivateDataInterface( 
        //    /* [annotation] */ 
        //    _In_  REFGUID guid,
        //    /* [annotation] */ 
        //    _In_opt_  const IUnknown *pData) = 0;
        //
        //
        //virtual HRESULT STDMETHODCALLTYPE GetDeviceRemovedReason( void) = 0;
        //
        //virtual HRESULT STDMETHODCALLTYPE SetExceptionMode( 
        //    UINT RaiseFlags) = 0;
        //
        //virtual UINT STDMETHODCALLTYPE GetExceptionMode( void) = 0;


			public:
				property DX4WRT::Direct3D::FeatureLevel FeatureLevel
				{ 
					DX4WRT::Direct3D::FeatureLevel get();
				}

				property DX4WRT::Direct3D11::DeviceCreate CreationFlags
				{
					DX4WRT::Direct3D11::DeviceCreate get ();
				}

				property DX4WRT::DXGI::IDevice^ DXGIDevice{ DX4WRT::DXGI::IDevice^ get();}
				property IDeviceContext^ ImmediateContext{ IDeviceContext^ get();}
		};

		public interface class IDevice1 : public IDevice
	    {
		    public:
        //virtual void STDMETHODCALLTYPE GetImmediateContext1( 
        //    /* [annotation] */ 
        //    _Out_  ID3D11DeviceContext1 **ppImmediateContext) = 0;
        //
        //virtual HRESULT STDMETHODCALLTYPE CreateDeferredContext1( 
        //    UINT ContextFlags,
        //    /* [annotation] */ 
        //    _Out_opt_  ID3D11DeviceContext1 **ppDeferredContext) = 0;
        //
        //virtual HRESULT STDMETHODCALLTYPE CreateBlendState1( 
        //    /* [annotation] */ 
        //    _In_  const D3D11_BLEND_DESC1 *pBlendStateDesc,
        //    /* [annotation] */ 
        //    _Out_opt_  ID3D11BlendState1 **ppBlendState) = 0;
        //
        //virtual HRESULT STDMETHODCALLTYPE CreateRasterizerState1( 
        //    /* [annotation] */ 
        //    _In_  const D3D11_RASTERIZER_DESC1 *pRasterizerDesc,
        //    /* [annotation] */ 
        //    _Out_opt_  ID3D11RasterizerState1 **ppRasterizerState) = 0;
        //
        //virtual HRESULT STDMETHODCALLTYPE CreateDeviceContextState( 
        //    UINT Flags,
        //    /* [annotation] */ 
        //    _In_reads_( FeatureLevels )  const D3D_FEATURE_LEVEL *pFeatureLevels,
        //    UINT FeatureLevels,
        //    UINT SDKVersion,
        //    REFIID EmulatedInterface,
        //    /* [annotation] */ 
        //    _Out_opt_  D3D_FEATURE_LEVEL *pChosenFeatureLevel,
        //    /* [annotation] */ 
        //    _Out_opt_  ID3DDeviceContextState **ppContextState) = 0;
        //
        //virtual HRESULT STDMETHODCALLTYPE OpenSharedResource1( 
        //    /* [annotation] */ 
        //    _In_  HANDLE hResource,
        //    /* [annotation] */ 
        //    _In_  REFIID returnedInterface,
        //    /* [annotation] */ 
        //    _Out_  void **ppResource) = 0;
        //
        //virtual HRESULT STDMETHODCALLTYPE OpenSharedResourceByName( 
        //    /* [annotation] */ 
        //    _In_  LPCWSTR lpName,
        //    /* [annotation] */ 
        //    _In_  DWORD dwDesiredAccess,
        //    /* [annotation] */ 
        //    _In_  REFIID returnedInterface,
        //    /* [annotation] */ 
        //    _Out_  void **ppResource) = 0;
		};
	}
}
